[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#298
Merged
Conversation
mssonicbld
commented
Apr 1, 2026
Collaborator
#### What I did On DPU platforms (pensando, nvidia-bluefield), the `routeCheck` monit service is removed from the monit config (sonic-net/sonic-buildimage#26214) since route checking is not applicable on DPUs. However, `config reload` unconditionally tries to `monit unmonitor/monitor routeCheck`, causing: ``` Disabling container and routeCheck monitoring ... There is no service named "routeCheck" ``` Added a `_monit_service_exists()` helper and guarded `routeCheck` monit calls in `_stop_services()` and `_restart_services()` so they only execute when the service is present in monit. #### How I did it - Added `_monit_service_exists(service)` helper that runs `sudo monit summary <service>` and returns `True`/`False` based on exit code. - In `_stop_services()`: only call `monit unmonitor routeCheck` if `_monit_service_exists("routeCheck")` returns `True`. - In `_restart_services()`: only call `monit monitor routeCheck` and `_wait_for_monit_service_monitored("routeCheck")` if the service exists. #### How to verify it 1. On a DPU platform (nvidia-bluefield / pensando) with routeCheck removed from monit config: - Run `config reload -y` — should complete without `"There is no service named routeCheck"` error 2. On a non-DPU platform where routeCheck exists in monit: - Run `config reload -y` — routeCheck monitoring should still be disabled/re-enabled as before #### Previous command output (if the output of a command-line utility has changed) On DPU with routeCheck removed from monit: ``` root@sonic-dpu-3:/home/admin# config reload -y Acquired lock on /etc/sonic/reload.lock Disabling container and routeCheck monitoring ... There is no service named "routeCheck" Released lock on /etc/sonic/reload.lock ``` #### New command output (if the output of a command-line utility has changed) On DPU with routeCheck removed from monit: ``` root@sonic-dpu-3:/home/admin# config reload -y Acquired lock on /etc/sonic/reload.lock Disabling container monitoring ... ... Enabling container monitoring ... Released lock on /etc/sonic/reload.lock ``` Companion PR: sonic-net/sonic-buildimage#26214 Fixes: sonic-net/sonic-buildimage#26225 Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.